/**
 * Author:MangoDai
 *
 * Date:${Date}
 *
 * Description:
 *
**/
 
#include <iostream>
using namespace std;
#include <cstdio>
#include <stdlib.h>
struct {
	int i;
	int w;
}Data;
int main(){
	__int64 s[61] = {0, 1};  
    int n, i, t, m;  
  
    for(i = 2; i < 61; i++)  
        s[i] = s[i - 1] * 2;  
  
    cin >> t;  
    while(t--)  
    {  
        cin >> n >> m;  
  
        cout << s[n - m + 1] << endl;  
    } 
}
// n number k compare i index
void fun(int* a, int* c, int n, int k, int i){

}

void move(){
	
}
